<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title><?php if(empty($post["title"])){echo $post["name"];}else{echo $post["title"];} ?></title><meta name="keywords" content="<?php echo $post["keywords"];?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"><link href="<?php echo http_host(); ?>/css/wap/style.css" type="text/css" rel="stylesheet"><script type="text/javascript" src="<?php echo http_host(); ?>/js/wap/jquery.min.js"></script><script type="text/javascript" src="<?php echo http_host(); ?>/js/wap/ad.js"></script></head><body>
{include file="common/header"/}

<h1 class="tit"><?php echo $post["name"]; ?></h1>

<div class="yi-w"><ul class="ulist" id="arclist"><?php if($list){foreach($list as $row){ ?>
<li><?php if($row['litpic']){ ?><a class="gpic" href="<?php echo model('Article')->getArticleDetailUrl(array('id'=>$row['id'])); ?>"><img alt="<?php echo $row["title"]; ?>" src="<?php echo $row["litpic"]; ?>"></a><?php } ?><a href="<?php echo model('Article')->getArticleDetailUrl(array('id'=>$row['id'])); ?>"><?php echo $row['title']; ?></a></li><?php }} ?></ul><div class="cl"></div>

</div><div id="lad1"><script>ljs1();</script></div>

<div class="dh2"><h2 class="tit2">猜你喜欢</h2><ul class="ulist"><?php if($relate_rand_list){foreach($relate_rand_list as $row){ ?>
<li><?php if($row['litpic']){ ?><a class="gpic" href="<?php echo model('Article')->getArticleDetailUrl(array('id'=>$row['id'])); ?>"><img alt="<?php echo $row["title"]; ?>" src="<?php echo http_host(); ?><?php echo $row["litpic"]; ?>"></a><?php } ?><a href="<?php echo model('Article')->getArticleDetailUrl(array('id'=>$row['id'])); ?>"><?php echo $row["title"]; ?></a></li><?php }} ?></ul><div class="cl"></div></div>

<div class="foot"><script>count_js();</script></div>

<script>
$(function(){
    var ajaxload  = false;
    var maxpage   = false;
    var startpage = 1;
    var totalpage = <?php echo $totalpage; ?>;
    
    var tmp_url   = window.location.href;
    msg = tmp_url.split("#");
    tmp_url = msg[0];
    
    $(window).scroll(function ()
    {
        var listheight = $("#arclist").outerHeight(); 
        
        if ($(document).scrollTop() + $(window).height() >= listheight)
        {
            if(startpage >= totalpage)
            {
                //$("#submit_bt_one").html("已是最后一页，没有更多数据");
                return false;
            }
            
            if(!ajaxload && !maxpage)
            {
                ajaxload = true;
                //$("#submit_bt_one").html("努力加载中...");
                var url = tmp_url;
                var nextpage = startpage+1;
                
                $.get(url,{page_ajax:1,page:nextpage},function(res)
                {
                    if(res)
                    {
                        $("#arclist").append(res);
                        startpage++;
                        
                        if(startpage >= totalpage)
                        {
                            maxpage = true;
                            //$("#submit_bt_one").html("已是最后一页，没有更多数据");
                            //$("#arclist").append('<div style="text-align:center;padding:10px;">暂无记录</div>');
                        }
                        else
                        {
                            //$("#submit_bt_one").html("点击加载更多");
                        }
                        
                        ajaxload = false;
                    }
                    else
                    {
                        //$("#submit_bt_one").html("请求失败，请稍后再试");
                        ajaxload = false;
                    }
                },'json');
            }
        }
    });
});
</script>
</body></html>